package com.imgpro.entity;

import jakarta.persistence.*; // Or javax.persistence.*
import lombok.*; // Import base Lombok annotations
import java.time.LocalDateTime;

/**
 * Represents a user entity corresponding to the 'users' table in the database.
 * Uses Lombok annotations to reduce boilerplate code.
 */
@Data // Bundles @Getter, @Setter, @ToString, @EqualsAndHashCode, @RequiredArgsConstructor
@NoArgsConstructor // JPA requires a no-argument constructor
@AllArgsConstructor // Optional: Provides a constructor with all arguments
@Builder // Optional: Provides the builder pattern, often useful for entities
@EqualsAndHashCode(onlyExplicitlyIncluded = true) // Crucial: Override default E&HC from @Data
@ToString(exclude = {"passwordHash"}) // Crucial: Exclude sensitive data from toString
@Entity
@Table(name = "users")
public class User {

    @Id
    private Long id;

    private String uuid;

    private String username;

    private String email;

    private String phoneNumber;

    // Password hash is handled by @Data's @Getter/@Setter
    // but EXCLUDED from @ToString and @EqualsAndHashCode
    private String passwordHash;

    private String avatarUrl;

    private Integer status = 1; // Default value

    private LocalDateTime createdAt;

    private LocalDateTime updatedAt;

    private LocalDateTime lastLoginAt;

}